[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
isxdigit() Test for Hexadecimal Digit (Macro)
#include <ctype.h>
int isxdigit(c);
int c; Integer value to be tested
isxdigit() tests whether 'c' is a hexadecimal digit; that is, 'A' -
'F', 'a' - 'f', or '0' -'9'.
Returns: Nonzero if the test is true and zero if it is false.
The result is undefined if 'c' is not an ASCII
character or EOF.
Notes: isxdigit() is a macro.
-------------------------------- Example ---------------------------------
The following statements prompt for a hexadecimal digit and process
only legal hex characters.
#include <ctype.h>
#include <stdio.h>
int ch, x = 0;
char *hdigit;
main()
{
printf("Enter a hexadecimal number: ");
while (isxdigit(ch = getch()))
/* store & process hex number */
}
See Also:
isalnum()
isalpha()
isascii()
iscntrl()
isdigit()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson